package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.MaterialMapper;
import com.education.wisdom.pojo.Material;
import com.education.wisdom.service.IMaterialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 素材资源 服务层实现
 * 
 * @author ruoyi
 * @date 2018-10-27
 */
@Service
public class MaterialServiceImpl implements IMaterialService
{
	@Autowired
	private MaterialMapper materialMapper;

	/**
     * 查询素材资源信息
     * 
     * @param mNumber 素材资源ID
     * @return 素材资源信息
     */
    @Override
	public Material selectMaterialById(String mNumber)
	{
	    return materialMapper.selectMaterialById(mNumber);
	}
	
	/**
     * 查询素材资源列表
     * 
     * @param map
     * @return 素材资源集合
     */
	@Override
	public List<Material> allMaterlByProId(Map<String,Object> map)
	{
	    return materialMapper.allMaterlByProId(map);
	}

	/**
	 * 查询素材总量
	 * @param map
	 * @return
	 */
	@Override
	public int count(Map<String,Object> map) {
		return materialMapper.count(map);
	}


	/**
	 * 查询素材资源名称列表
	 *
	 * @param mProfessionid 专业编号
	 * @return 素材资源集合
	 */
	@Override
	public List<Material> selectMaterialNameByProId(String mProfessionid)
	{
		return materialMapper.selectMaterialNameByProId(mProfessionid);
	}

	/**
	 * 素材筛选 所有
	 *
	 * @return
	 */
	@Override
	public List<Material> allMaterl(Map<String,Object> map) {
		return materialMapper.allMaterl(map);
	}

	/**
	 * 素材筛选 最新
	 *
	 * @return
	 */
	@Override
	public List<Material> newMaterl(Map<String,Object> map) {
		return materialMapper.newMaterl(map);
	}


	/**
	 * 素材筛选 最热
	 *
	 * @return
	 */
	@Override
	public List<Material> hotMaterl(Map<String,Object> map) {
		return materialMapper.hotMaterl(map);
	}
	/**
     * 新增素材资源
     * 
     * @param material 素材资源信息
     * @return 结果
     */
	@Override
	public int insertMaterial(Material material)
	{
	    return materialMapper.insertMaterial(material);
	}
	
	/**
     * 修改素材资源
     * 
     * @param material 素材资源信息
     * @return 结果
     */
	@Override
	public int updateMaterial(Material material)
	{
	    return materialMapper.updateMaterial(material);
	}

	/**
     * 删除素材资源对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteMaterialByIds(String ids)
	{
		return materialMapper.deleteMaterialByIds(Convert.toStrArray(ids));
	}
	/**
     * 查询用户素材资源列表
     * 
     * @param mProfessionid 所属专业编号
     * @return 素材资源集合
     */
	@Override
	public List<Material> selectUserMaterialList(Map<String, Object> map) {
		return materialMapper.selectUserMaterialList(map);
	}

	
	
}
